package com.tianji.learning.controller.admin;

import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.Vo.LearningNoteAdminPageVo;
import com.tianji.learning.domain.Vo.LearningNoteVO;
import com.tianji.learning.domain.Vo.NoteDetailVo;
import com.tianji.learning.domain.dto.AddNoteDTO;
import com.tianji.learning.domain.query.NoteAdminPageQuery;
import com.tianji.learning.service.ILearningNoteService;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 笔记表 控制器
 * </p>
 *
 * @author author
 */
@Api(tags = "LearningNote管理")
@RestController
@RequiredArgsConstructor
@RequestMapping("/admin/notes")
public class LearningNoteAdminController {

    private final ILearningNoteService learningNoteService;

    @GetMapping("/page")
    public PageDTO<LearningNoteAdminPageVo> pageQueryAdmin(NoteAdminPageQuery query){
        return learningNoteService.pageQueryAdmin(query);
    }
    @GetMapping("/{id}")
    public NoteDetailVo getNoteDetailById(@PathVariable("id")Long id){
        return learningNoteService.getNoteDetailById(id);
    }

}
